package com.netbetter.langzheng.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.DeferredCommand;

import com.allen_sauer.gwt.log.client.Log;
import com.extjs.gxt.ui.client.GXT;
import com.extjs.gxt.ui.client.mvc.Dispatcher;
import com.extjs.gxt.ui.client.util.Theme;
import com.netbetter.langzheng.client.mvc.AppController;
import com.netbetter.langzheng.commons.constants.AppEvents;
import com.netbetter.langzheng.plugin.fileManager.FileManagerController;

/**
 * langzheng 即琅铮，国人希望更是川人骄傲
 * 
 * @author 嘉陵江里捉鱼
 * 
 */
public class Langzheng implements EntryPoint {

  public void onModuleLoad() {
      GXT.setDefaultTheme(Theme.BLUE, true);
      GXT.hideLoadingPanel("loading");

      Log.setCurrentLogLevel(Log.getLowestLogLevel());
      Log.setUncaughtExceptionHandler();

      DeferredCommand.addCommand(new Command() {
        public void execute() {
          Dispatcher dispatcher = Dispatcher.get();
          dispatcher.addController(new AppController());
          dispatcher.addController(new FileManagerController());
          // dispatcher.addController(new TaskController());
          dispatcher.dispatch(AppEvents.Init);
        }
      });

  }

}
